package cn.springcloud.fix.common.core.exception;

import cn.springcloud.fix.common.core.enums.ResponseEnum;
import lombok.Getter;

@Getter
public class BaseException extends Exception {

    private ResponseEnum responseEnum;

    /**
     * 默认是系统异常
     */
    public BaseException() {
        this.responseEnum = ResponseEnum.ERROR;
    }

    public BaseException(ResponseEnum errorType) {
        this.responseEnum = errorType;
    }

    public BaseException(ResponseEnum errorType, String message) {
        super(message);
        this.responseEnum = errorType;
    }

    public BaseException(ResponseEnum errorType, String message, Throwable cause) {
        super(message, cause);
        this.responseEnum = errorType;
    }

    public BaseException(String message) {
        super(message);
    }

    public BaseException(Throwable cause) {
        super(cause);
    }

    public BaseException(String message, Throwable cause) {
        super(message, cause);
    }

    public BaseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }
}
